from selenium import webdriver
import time
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities



list={'chrome': 'http://127.0.0.1:4444/wd/hub',
      'internet explorer':'http://127.0.0.1:4444/wd/hub'}

for browser, host in list.items():
    print(host, browser)
    driver=webdriver.Remote(command_executor=host,
                            desired_capabilities={'platform':'ANY',
                                                    'browserName':browser,
                                                    'version':'',
                                                    'javascriptEnabled':True})

    driver.get('http://www.baidu.com')
    driver.find_element_by_id('kw').send_keys(browser)
    driver.find_element_by_id('su').click()
    driver.close()
